#!/usr/bin/env python
from werkzeug import script

def make_app():
  from application import SilkWeb
  return SilkWeb()

def make_shell():
  application = make_app()
  return locals()

def serve():
  action_runserver = script.make_runserver(make_app, hostname='0.0.0.0',
                                           use_reloader=True)
  # action_shell = script.make_shell(make_shell)
  action_initdb = lambda: make_app().init_database()

  script.run(args=['runserver'])
